<style>
    .xh-form .btn{
        margin-right: 0px;
    }
    /*.xh-form tr td:nth-child(2n){*/
    /*padding: 5px 20px 5px 0;*/
    /*}*/
    td >label{
        float: right;
        margin-right: 10px;
    }
    body{
        background-color: #f9f9f9;
    }

</style>
<script>
    var data = {{ info['mData'] | json_encode }};
    var prod = {{ prod | json_encode }};
</script>

<div class="form-inline" style="padding: 5px;background-color: #bdf3dc;">
    <div class="form-group" style="margin: 0px;">
        <label>全部选择：</label>
        <select id="allDev" class="form-control " style="display: inline-block;width: 150px;">
            <option value="" style="display: none" selected>请选择</option>
            {% for id,text in prod %}
                <option value="{{ id }}">{{ text }}</option>
            {% endfor %}
        </select>
        <a id="bt_view_usage" class="btn btn-success btn-sm" style="margin-left: 15px;width: 80px;">执行替换</a>
        <a id="bt_view_replacePart" class="btn btn-success btn-sm" style="margin-left: 15px;width: 80px;">部分替换</a>
    </div>
</div>
<form id="xh_form"   method="post"  >
    <div class="xh-area-form">
        <table style="width: 100%" class="table" >
            {% if info['iSource'] == 2 %}
                <tr class="info">
                    <th style="text-align: center">名称</th>
                    <th style="text-align: center">设备类型</th>
                    <th style="text-align: center">设备号</th>
                </tr>
                {% for i,item in info['mData']  %}
                    <tr >
                        <td>{% if item['sSchoolName'] is defined %} {{ item['sSchoolName'] }} ({{ item['sUserName'] }}) {% else %} {{ item['sUserName'] }}   {% endif %}</td>
                        <td>
                            <select class="sDevType" >
                                {% for id,text in prod %}
                                    <option value="{{ id }}" {% if text == item['sDevType']  %} selected {% endif %} >{{ text }}</option>
                                {% endfor %}
                            </select>
                        </td>
                        <td>
                            <input class="sDevNumber" value="{{ item['sDevNumber'] }}" readonly>
                        </td>
                    </tr>
                {% endfor %}
            {% endif %}
            {% if info['iSource'] == 3 %}
                <tr class="info">
                    <th style="text-align: center">名称</th>
                    <th style="text-align: center">设备类型</th>
                    <th style="text-align: center">设备号</th>
                </tr>
                {% for i,item in info['mData']  %}
                    <tr >
                        <td>{% if item['sSchoolName'] is defined %} {{ item['sSchoolName'] }} ({{ item['sUserName'] }}) {% else %} {{ item['sUserName'] }}   {% endif %}</td>
                        <td>
                            <select class="sDevType" >
                                {% for id,text in prod %}
                                    <option value="{{ id }}" {% if text == item['sDevType']  %} selected {% endif %} >{{ text }}</option>
                                {% endfor %}
                            </select>
                        </td>
                        <td>
                            <input class="sDevNumber" value="{{ item['sDevNumber'] }}" readonly>
                        </td>
                    </tr>
                {% endfor %}
            {% endif %}
            {% if info['iSource'] == 1 %}
                <tr class="info">
                    <th style="text-align: center">名称</th>
                    <th style="text-align: center">领用类型</th>
                    <th style="text-align: center">设备类型</th>
                    <th style="text-align: center">设备号</th>
                </tr>
                {% for i,item in info['mData']  %}
                    <tr >
                        {% if item['iReceivePurpose'] == '自用机'  %}
                                <td>{{ item['sReceiverName'] }}</td>
                            {% else %}
                                <td>{% if item['sSchoolName'] is defined %} {{ item['sSchoolName'] }} ({{ item['sUserName'] }}) {% else %} {{ item['sUserName'] }}   {% endif %}</td>
                        {% endif %}
                        <td>
                            {{ item['iReceivePurpose'] }}
                        </td>
                        <td>
                            <select class="sDevType" >
                                {% for id,text in prod %}
                                    <option value="{{ id }}" {% if text == item['sDevType']  %} selected {% endif %} >{{ text }}</option>
                                {% endfor %}
                            </select>
                        </td>
                        <td>
                            <input class="sDevNumber" value="{{ item['sDevNumber'] }}" readonly>
                        </td>
                    </tr>
                {% endfor %}
            {% endif %}
        </table>
    </div>
</form>
{% if totalRecord %}
    <div id="title" style="color: grey;position: fixed;bottom: 0;left: 0;right: 0;background-color: #f9f9f9">{{ totalRecord }}</div>
{% endif %}